Skip to content

Add macro to simplify into_full_block implementations#9294

Merged
mergify[bot] merged 2 commits into
sigp:unstablefrom
macladson:full-block-macro
May 25, 2026
Merged

Add macro to simplify into_full_block implementations#9294
mergify[bot] merged 2 commits into
sigp:unstablefrom
macladson:full-block-macro

Conversation

@macladson

Copy link
Copy Markdown
Member

Proposed Changes

Use a macro to remove the repetitive fork variant boilerplate in signed_beacon_block.rs when implementing into_full_block for the various SignedBeaconBlock variants

@macladson macladson added code-quality ready-for-review The code is ready for review low-hanging-fruit Easy to resolve, get it before someone else does! labels May 12, 2026

@chong-he chong-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what this PR is doing but I can't say I understand everything in the macro itself.

This is to use macro to replace the repeated into_full_block function for each fork, with a flexibility of having some extra fields in the body for some forks.

Nice simplification, looks good to me overall.

Comment on lines -436 to -437
// NOTE: It might be nice to come up with a `superstruct` pattern to abstract over this before
// the first fork after Bellatrix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIP this comment 🤣

@michaelsproul michaelsproul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dank and delicious

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels May 25, 2026
@mergify mergify Bot added the queued label May 25, 2026
@mergify

mergify Bot commented May 25, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 29 minutes 37 seconds in the queue, including 27 minutes 42 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request May 25, 2026
mergify Bot added a commit that referenced this pull request May 25, 2026
@mergify mergify Bot merged commit 89ee020 into sigp:unstable May 25, 2026
38 checks passed
@mergify mergify Bot removed the queued label May 25, 2026
@macladson macladson deleted the full-block-macro branch May 25, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality low-hanging-fruit Easy to resolve, get it before someone else does! ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants